home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / c / cweb31p9d.lha / CWeb / makefile.unix < prev    next >
Makefile  |  1994-07-02  |  8KB  |  275 lines

  1. # This file, makefile.unix, is part of CWEB.
  2. # It is distributed WITHOUT ANY WARRANTY, express or implied.
  3.  
  4. # Modified for the CC compiler under HP-UX on a HP Apollo 400 at Bayreuth
  5. # University by Andreas Scherer (sorry, no e-mail; Abt-Wolf-Straße 17,
  6. # 96215 Lichtenfels, Federal Republic of Germany), July 1, 1994.
  7. # Other UNIX compilers like c89 or gcc can work with this file as well.
  8.  
  9. # Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
  10. # Copyright (C) 1994 Andreas Scherer
  11.  
  12. # Permission is granted to make and distribute verbatim copies of this
  13. # document provided that the copyright notice and this permission notice
  14. # are preserved on all copies.
  15.  
  16. # Permission is granted to copy and distribute modified versions of this
  17. # document under the conditions for verbatim copying, provided that the
  18. # entire resulting derived work is distributed under the terms of a
  19. # permission notice identical to this one.
  20.  
  21. # Read the README file, then edit this file to reflect local conditions
  22. #
  23.  
  24. # directory for TeX inputs (cwebmac.tex, ccwebmac.tex, or gcwebmac.tex go here)
  25. MACROSDIR= /usr/local/lib/tex/inputs
  26.  
  27. # directory for CWEB inputs in @i files
  28. CWEBINPUTS=/usr/local/lib/cweb
  29.  
  30. # extension for manual pages ("l" distinguishes local from system stuff)
  31. MANEXT= l
  32. #MANEXT= 1
  33.  
  34. # directory for manual pages (cweb.1 goes here)
  35. MANDIR= /usr/man/man$(MANEXT)
  36.  
  37. # destination directory for executables; must end in /
  38. DESTDIR= /usr/local/bin/
  39.  
  40. # directory for GNU EMACS Lisp code (cweb.el goes here)
  41. EMACSDIR= /usr/local/emacs/lisp
  42.  
  43. # directory for the language header file "cweb.h"
  44. CATINCLUDE=./bin/catalogs
  45.  
  46. # Set DESTPREF to null if you want to call the executables "tangle" and "weave"
  47. # (probably NOT a good idea; we recommend leaving DESTPREF=c)
  48. DESTPREF=c
  49.  
  50. # Set COMMONH to the name of the file `common.h' or any alternative to
  51. # the original `common.h'.
  52. COMMONH=comm-p.h
  53.  
  54. # Set CHCHANGES to comm-foo.hch if you need changes to common.h
  55. CHCHANGES=comm-p.hch
  56.  
  57. # Set CCHANGES to comm-foo.ch if you need changes to common.w
  58. CCHANGES=common.ch
  59.  
  60. # Set TCHANGES to ctang-foo.ch if you need changes to ctangle.w
  61. TCHANGES=ctangle.ch
  62.  
  63. # Set WCHANGES to cweav-foo.ch if you need changes to cweave.w
  64. WCHANGES=cweave.ch
  65.  
  66. # Set PCHANGES to prod-foo.ch if you need changes to prod.w
  67. PCHANGES=
  68.  
  69. # Set MCHANGES to wmerge-foo.ch if you need changes to wmerge.w
  70. MCHANGES=wmerge.ch
  71.  
  72. # We keep debugging info around, for fun, but most users don't need it.
  73. # These lists of arguments are specific for CC.  Change, add or delete
  74. # things here to suit your personal conditions.
  75. # The following set of options work for CC 8.00 on HP-UX 8.00.
  76. CFLAGS = -g -tp,/usr/local/bin/cpp.sh -I$(CATINCLUDE) \
  77.     -DCWEBINPUTS=\"$(CWEBINPUTS)\" -O
  78.  
  79. # The following set of options work for CC 9.30 on HP-UX 9.01.
  80. #CFLAGS = -g -Aa -I$(CATINCLUDE) -DCWEBINPUTS=\"$(CWEBINPUTS)\" +O3
  81.  
  82. # The following set of options work for CC and GCC on SunOS 4 and SGI's
  83. # IRIX 4.0.5.  They are standard for many other UNIX-C compilers.
  84. #CFLAGS = -g -I$(CATINCLUDE) -DCWEBINPUTS=\"$(CWEBINPUTS)\" -O
  85.  
  86. # All linkers tested worked fine with this option.
  87. LINKFLAGS = -g
  88. #LINKFLAGS = -s # for smaller (stripped) executables on many UNIX systems
  89.  
  90. # By default my version of cweave includes the option for AMIGA keywords
  91. # and the use of German macros.  So you have to switch these off for all
  92. # the CWEB documentation.  Also the `f' flag is turned off to save paper
  93. WFLAGS=-fag
  94.  
  95. # What C compiler are you using?
  96. CC = cc
  97. MAKE = make
  98.  
  99. # RM and CP are used below in case rm and cp are aliased
  100. RM= /bin/rm
  101. CP= /bin/cp
  102.  
  103. ##########  You shouldn't have to change anything after this point #######
  104.  
  105. CWEAVE = ./bin/cweave
  106. CTANGLE = ./bin/ctangle
  107. WMERGE=./bin/wmerge
  108. SOURCES = cweave.w common.w ctangle.w
  109. ALMOSTALL = common.w ctangle.w wmerge.w makefile readme \
  110.     common.c common.h $(COMMONH) ctangle.c wmerge.c \
  111.     cwebman.tex cwebmang.ch cweb.1 cweb.man cweb.el prod.w \
  112.     $(CCHANGES) $(CHCHANGES) $(TCHANGES) $(WCHANGES) $(PCHANGES) \
  113.     comm-vms.ch ctang-vms.ch cweav-vms.ch \
  114.     comm-man.ch ctang-man.ch cweav-man.ch \
  115.     makefile.amiga makefile.pc makefile.unix \
  116.     $(MACROSDIR)cwebmac.tex $(MACROSDIR)ccwebmac.tex $(MACROSDIR)gcwebmac.tex \
  117.     $(CATINCLUDE)cweb.h examples
  118. ALL =  $(ALMOSTALL) cweave.w
  119.  
  120. .SUFFIXES: .dvi .tex .w
  121.  
  122. .w.tex:
  123.     $(CWEAVE) $(WFLAGS) $* $*
  124.  
  125. .tex.dvi:    
  126.     tex $<
  127.  
  128. .w.dvi:
  129.     $(MAKE) $*.tex
  130.     $(MAKE) $*.dvi
  131.  
  132. .c.o:
  133.     $(CC) $(CFLAGS) -c $*.c
  134.  
  135. .w.c:
  136.     $(CTANGLE) $* $*
  137.  
  138. .w.o:
  139.     $(MAKE) $*.c
  140.     $(MAKE) $*.o
  141.  
  142. # When you say `make' without any arguments, `make' will jump to this item
  143. default: ctangle cweave
  144.  
  145. # The complete set of files contains the two programs `ctangle' and
  146. # `cweave' plus the program `wmerge', the manuals `cwebman' and `cwebmang'
  147. # and the source documentations.
  148. all: progs docs
  149.  
  150. # The objects of desire
  151. progs: ctangle cweave wmerge
  152.  
  153. cautiously: ctangle
  154.     $(CP) common.c SAVEcommon.c
  155.     $(CTANGLE) common $(CCHANGES)
  156.     diff common.c SAVEcommon.c
  157.     $(RM) SAVEcommon.c
  158.     $(CP) ctangle.c SAVEctangle.c
  159.     $(CTANGLE) ctangle $(TCHANGES)
  160.     diff ctangle.c SAVEctangle.c
  161.     $(RM) SAVEctangle.c
  162.  
  163. SAVEctangle.c:
  164.     $(CP) ctangle.c SAVEctangle.c
  165.  
  166. SAVEcommon.c:
  167.     $(CP) common.c SAVEcommon.c
  168.  
  169. common.c: common.w $(CCHANGES)
  170.     $(CTANGLE) common $(CCHANGES)
  171.  
  172. common.o: common.c $(CATINCLUDE)cweb.h
  173.  
  174. ctangle: ctangle.o common.o
  175.     $(CC) $(LINKFLAGS) -o ctangle ctangle.o common.o 
  176.  
  177. ctangle.c: ctangle.w $(TCHANGES) $(COMMONH)
  178.     $(CTANGLE) ctangle $(TCHANGES)
  179.  
  180. ctangle.o: ctangle.c $(CATINCLUDE)cweb.h $(COMMONH)
  181.  
  182. cweave: cweave.o common.o
  183.     $(CC) $(LINKFLAGS) -o cweave cweave.o common.o
  184.  
  185. cweave.c: cweave.w $(WCHANGES) $(COMMONH)
  186.     $(CTANGLE) cweave $(WCHANGES)
  187.  
  188. cweave.o: cweave.c $(CATINCLUDE)cweb.h $(COMMONH)
  189.  
  190. wmerge: wmerge.c
  191.     $(CC) $(CFLAGS) -o wmerge wmerge.c
  192.  
  193. wmerge.c: wmerge.w $(MCHANGES)
  194.     $(CTANGLE) wmerge $(MCHANGES)
  195.  
  196. # additional rules to `wmerge' the remaining files
  197. #
  198. $(COMMONH): common.h $(CHCHANGES)
  199.     $(WMERGE) common.h $(CHCHANGES) $(COMMONH)
  200.  
  201. # Take a good lecture for bedtime reading
  202. doc: $(SOURCES:.w=.dvi)
  203.  
  204. docs: cwebman.dvi cwebmang.dvi common.dvi ctangle.dvi cweave.dvi wmerge.dvi
  205.  
  206. cwebman.dvi: cwebman.tex
  207. cwebmang.dvi: cwebmang.tex
  208. common.dvi: common.tex
  209. ctangle.dvi: ctangle.tex
  210. cweave.dvi: cweave.tex
  211. wmerge.dvi: wmerge.tex
  212.  
  213. usermanual: cwebmang.dvi
  214.  
  215. fullmanual: usermanual $(SOURCES) comm-man.ch ctang-man.ch cweav-man.ch
  216.     $(MAKE) cweave
  217.     $(CWEAVE) common.w comm-man.ch
  218.     $(MAKE) common.dvi
  219.     $(CWEAVE) ctangle.w ctang-man.ch
  220.     $(MAKE) ctangle.dvi
  221.     $(CWEAVE) cweave.w cweav-man.ch
  222.     $(MAKE) cweave.dvi
  223.  
  224. cwebmang.tex: cwebman.tex cwebmang.ch
  225.     $(WMERGE) cwebman.tex cwebmang.ch cwebmang.tex
  226.  
  227. # for making the documentation we will have to include the change files
  228. ctangle.tex: ctangle.w $(COMMONH) $(TCHANGES)
  229.     $(CWEAVE) $(WFLAGS) ctangle $(TCHANGES)
  230.  
  231. cweave.tex: cweave.w $(COMMONH) $(WCHANGES)
  232.     $(CWEAVE) $(WFLAGS) cweave $(WCHANGES)
  233.  
  234. common.tex: common.w $(CCHANGES)
  235.     $(CWEAVE) $(WFLAGS) common $(CCHANGES)
  236.  
  237. wmerge.tex: wmerge.w $(MCHANGES)
  238.     $(CWEAVE) $(WFLAGS) wmerge $(MCHANGES)
  239.  
  240. # be sure to leave ctangle.c and common.c and $(COMMONH) for bootstrapping
  241. clean:
  242.     $(RM) -f -r *~ *.o common.tex cweave.tex cweave.c ctangle.tex \
  243.     *.log *.dvi *.toc *.idx *.scn core cweave.w.[12] cweave ctangle \
  244.     cwebmang.tex wmerge.tex wmerge
  245.  
  246. # Install the new program versions where they can be found
  247. install: all
  248.     $(CP) cweave $(DESTDIR)$(DESTPREF)weave
  249.     chmod 755 $(DESTDIR)$(DESTPREF)weave
  250.     $(CP) ctangle $(DESTDIR)$(DESTPREF)tangle
  251.     chmod 755 $(DESTDIR)$(DESTPREF)tangle
  252.     $(CP) cweb.1 $(MANDIR)/cweb.$(MANEXT)
  253.     chmod 644 $(MANDIR)/cweb.$(MANEXT)
  254.     $(CP) cwebmac.tex $(MACROSDIR)
  255.     chmod 644 $(MACROSDIR)/cwebmac.tex
  256.     $(CP) cweb.el $(EMACSDIR)
  257.     chmod 644 $(EMACSDIR)/cweb.el
  258.  
  259. bundle: $(ALL)
  260.     sed -n '1,2200 p' cweave.w > cweave.w.1
  261.     sed -n '2201,$$ p' cweave.w > cweave.w.2
  262.     /usr/local/bin/shar -m100000 -c -v -f cweb $(ALMOSTALL) cweave.w.[12]
  263.  
  264. tags: $(ALL)
  265.     etags -z $(ALL)
  266.  
  267. cweb.tar: $(ALL)
  268.     tar cvhf cweb.tar $(ALL)
  269.  
  270. floppy: $(ALL)
  271.     bar cvhf /dev/rfd0 $(ALL)
  272.     bar tvf /dev/rfd0
  273.     eject
  274.